<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="__ROOT__/Public/Admin/css/shortcut icon" href="favicon.ico">
    <link href="__ROOT__/Public/Admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__ROOT__/Public/Admin/css/animate.css" rel="stylesheet">
    <link href="__ROOT__/Public/Admin/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__ROOT__/Public/Admin/js/plugins/cityPicker/city-picker.css" rel="stylesheet">
    <link href="__ROOT__/Public/Admin/js/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__ROOT__/Public/Admin/css/edit.css" rel="stylesheet"/>

<style>

</style>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
       
        <div class="row">
            <form class="form-horizontal m-t js-ajax-forms" id="signupForm" action="<if condition="$editdata">{:U('Admin/Contract/update')}<else />{:U('Admin/Contract/add')}</if>" method="post" enctype="multipart/form-data">
            <input type="hidden" name="ID" value="{$editdata['ID']}">
            <div class="col-sm-8  col-md-offset-2">
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
                            <div class="form-group">
                                <label class="col-sm-3 control-label">合同标题 * </label>
                                <div class="col-sm-8">
                                    <input id="Title" name="Title" class="form-control" type="text" aria-required="true" aria-invalid="true" class="error" value="{$editdata.Title}">
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-3 control-label">选择项目 * </label>
                                <div class="col-sm-8">
                                    <input id="ProjectName" name="ProjectName" class="form-control selector-icon" type="text" aria-required="true" aria-invalid="true" class="error" value="{$editdata.ProjectName}">

                                    <input id="ProjectID"  type='hidden'  name="ProjectID" aria-required="true" aria-invalid="true" class="error" value='{$editdata.ProjectID}'>
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-3 control-label">收入/支出合同 * </label>
                                <div class="col-sm-8">
                                    <select class="form-control" id="InOutType" name="InOutType" aria-required="true" aria-invalid="true" class="error">
                                        <!-- <option value="">请选择收入/支出合同{$editdata['InOutType']}</option> -->
                                        <foreach name="data.selectlist.InOutType" item="vo">
                                            <option <if condition="$vo.ID eq $editdata['InOutType']"> selected </if> value="{$vo.ID}">{$vo.Name}</option>
                                        </foreach>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">合同类型 * </label>
                                <div class="col-sm-8">
                                    <select class="form-control" id="ContractType" name="ContractType" aria-required="true" aria-invalid="true" class="error">
                                        <option value="">请选择合同类型</option>
                                        <foreach name="data.selectlist.ContractType" item="vo">
                                            <option <if condition="$vo.ID eq $editdata['ContractType']"> selected </if> value="{$vo.ID}">{$vo.Name}</option>
                                        </foreach>
                                    </select>
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-3 control-label">合同分级</label>
                                <div class="col-sm-8">
                                    <select class="form-control" id="ContractLevel" name="ContractLevel" aria-required="true" aria-invalid="true" class="error">
                                        <option value="">请选择合同分级</option>
                                        <foreach name="data.selectlist.ContractLevel" item="vo">
                                            <option <if condition="$vo.ID eq $editdata['ContractLevel']"> selected </if> value="{$vo.ID}">{$vo.Name}</option>
                                        </foreach>
                                    </select>
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <hr/>
                            </div>
                            <!-- 做输入匹配 -->
                            <div class="form-group">
                                <label class="col-sm-3 control-label"> 甲方 * </label>
                                <div class="col-sm-8">
                                    <input id="FPIDName"  class="form-control selector-icon"  name="FPIDName" aria-required="true" aria-invalid="true" class="error" value='{$editdata.FPIDName}'>
                                    <input id="FPID"  type='hidden'  name="FPID" aria-required="true" aria-invalid="true" class="error" value='{$editdata.FPID}'>
                                </div>
                            </div>
                            <!-- 做输入匹配 -->
                            <div class="form-group">
                                <label class="col-sm-3 control-label"> 乙方 * </label>
                                <div class="col-sm-8">
                                  <input id="SPIDName"    class="form-control selector-icon"  name="SPIDName" aria-required="true" aria-invalid="true" class="error" value='{$editdata.SPIDName}'>
                                    <input id="SPID"  type='hidden'  class="form-control selector-icon"  name="SPID" aria-required="true" aria-invalid="true" class="error"
                                    value='{$editdata.SPID}'
                                    >
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-3 control-label"> 合同金额 * </label>
                                <div class="col-sm-8">
                                    <input id="Bill" name="Bill"  class="form-control" type="text" aria-required="true" aria-invalid="true" class="error" type="text"  value="{$editdata.Bill}">
                                </div>
                            </div>

                             <div class="form-group">
                                <label class="col-sm-3 control-label"> 合同年金额 * </label>
                                <div class="col-sm-8">
                                    <input id="YearBill" name="YearBill"  class="form-control" type="text" aria-required="true" aria-invalid="true" class="error" type="text"  value="{$editdata.YearBill}">
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-3 control-label"> 合同月金额 * </label>
                                <div class="col-sm-8">
                                    <input id="MonthBill" name="MonthBill"  class="form-control" type="text" aria-required="true" aria-invalid="true" class="error" type="text"  value="{$editdata.MonthBill}">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-3 control-label"> 合同保证金 * </label>
                                <div class="col-sm-8">
                                    <input id="Bond" name="Bond"  class="form-control" type="text" aria-required="true" aria-invalid="true" class="error" type="text"  value="{$editdata.Bond}">
                                </div>
                            </div>

                             <div class="form-group has-success">
                                <label class="col-sm-3 control-label" style="color:#686b6d">甲方签字日期</label>
                                <div class="col-sm-8">
                                    <input style="border-color:#cfdadd" type="text" id="FPWriteDate" name="FPWriteDate" class="form-control date laydate-icon" value="{$editdata.FPWriteDate}">
                                </div>
                            </div>

                            <div class="form-group has-success">
                                <label class="col-sm-3 control-label" style="color:#686b6d">乙方签字日期</label>
                                <div class="col-sm-8">
                                    <input style="border-color:#cfdadd" type="text" id="SPWriteDate" name="SPWriteDate" class="form-control date laydate-icon" value="{$editdata.SPWriteDate}">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-3 control-label"> 备注 </label>
                                <div class="col-sm-8">
                                    <textarea id="Memo" name="Memo"  class="form-control"   value="{$editdata.Memo}"> {$editdata.Memo}</textarea> 
                                </div>
                            </div>

                            <div class="form-group has-success">
                                <label class="col-sm-3 control-label" style="color:#686b6d">合同相关方</label>
                                <div class="col-sm-8" >

                                    <a  class="btn btn-primary keep" id='ContractPartner' >新增合同相关方</a>
                                    <div id='ContractPartnerList' style="padding:10px" >
                                        <input type='hidden' id='multipart' value='0'>
                                        <foreach name="editdata.ContractPartner" item="vo">
                                            <div class="badge badge-success"  style="margin-right:10px"><b>{$vo.CPIDName}</b>
                                            <if condition="$vo.PartnerType eq 2"> <b class="pxx"></b> <else /></if>
                                            : {$vo.Name}<i style="cursor:pointer" onclick="cpdelete(this)" class="fa fa-times-circle"></i>
                                            <input type='hidden' name='ContractPartnerList[]' value='{"ID":"","PartnerType":"<?php echo $vo["PartnerType"];?>","CPIDName":"<?php echo $vo["Name"];?>","CPID":"<?php echo $vo["CPID"];?>"}'></div>
                                        </foreach>
                                    </div>
                                </div>
                            </div>

<!--                             <div class="form-group has-success">
                                <label class="col-sm-3 control-label" style="color:#686b6d">合同正文</label>
                                <div class="col-sm-8">
                                    <a  class="btn btn-primary keep"  id='ContractBody' >新增合同正文</a>
                                </div>
                            </div>


                            <div class="form-group has-success">
                                <label class="col-sm-3 control-label" style="color:#686b6d">合同附件</label>
                                <div class="col-sm-8">
                                    <a  class="btn btn-primary keep"  id='ContractAttachment' >上传合同附件</a>
                                </div>
                            </div> -->
                            
                            <div class="form-group">
                                <hr/>
                            </div>
                      
                            <div class="form-group">
                                <label class="col-sm-3 control-label">合同签订人 * </label>
                                <div class="col-sm-8">
                                    <input id='UserID'  aria-required="true" aria-invalid="true" class="error" name='UserID' value="{$editdata.UserID}" type="hidden">
                                    <input id="UserName" name="UserName" class="form-control selector-icon" name="ContractType" aria-required="true" aria-invalid="true" class="error" onclick="openselector('UserID','UserName')" data-toggle="modal" data-target="#myModal" type="text"  value="{$editdata.UserName}">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-3 control-label">合同签约领导 * </label>
                                <div class="col-sm-8">
                                    <input id='LeaderUserID' name="LeaderUserID" aria-required="true" aria-invalid="true" class="error"  value="{$editdata.LeaderUserID}" type="hidden">
                                    <input id="LeaderName" name="LeaderName" class="form-control selector-icon" name="LeaderName" aria-required="true" aria-invalid="true" class="error" onclick="openselector('LeaderUserID','LeaderName')" data-toggle="modal" data-target="#myModal" type="text"  value="{$editdata.LeaderName}">
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-3 control-label">承办部门 * </label>
                                <div class="col-sm-8">
                                    <input id='DepID'  aria-required="true" aria-invalid="true" class="error" name='DepID' value="{$editdata.DepID}" type="hidden">
                                    <input id="DepName" name="DepName" class="form-control selector-icon"  name="ContractType" aria-required="true" aria-invalid="true" class="error" onclick="openselector('DepID','DepName')" data-toggle="modal" data-target="#myModal" type="text"  value="{$editdata.DepName}">
                                </div>
                            </div>
                            
                            <div class="form-group has-success">
                                <label class="col-sm-3 control-label" style="color:#686b6d">合同创建日期 * </label>
                                <div class="col-sm-8">
                                    <input style="border-color:#cfdadd" type="text" id="CreateDate"  name="CreateDate" class="form-control date laydate-icon" value="{$editdata.CreateDate}">
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-sm-8 col-sm-offset-3">
                                    <a class="btn btn-white" href="javascript:void(0);" onclick="self.location=document.referrer;">返回</a>
                                    &nbsp&nbsp&nbsp
                                    <button class="btn btn-primary keep" type="submit">下一步</button>
                                </div>
                            </div>
                        
                    </div>
                </div>
            </div>
           
            </form>
        </div>
    </div>
    <script src="__ROOT__/Public/Admin/js/jquery.min.js"></script>
    <script src="__ROOT__/Public/Admin/js/bootstrap.min.js"></script>
    <script src="__ROOT__/Public/Admin/js/plugins/layer/laydate/laydate.js"></script>
    <script src="__ROOT__/Public/Admin/js/plugins/layer/layer.min.js"></script>
    <script src="__ROOT__/Public/Admin/js/plugins/validate/jquery.validate.min.js"></script>
    <script src="__ROOT__/Public/Admin/js/ajaxForm.js"></script>
    <script src="__ROOT__/Public/Admin/js/plugins/sweetalert/sweetalert.min.js"></script>
    <link href="__ROOT__/Public/Admin/css/selector/selectorstyle.css" rel="stylesheet"/>
    <script src="__ROOT__/Public/Admin/js/plugins/selector/selector.js"></script>
    <script src="__ROOT__/Public/Admin/js/plugins/selector/jquery.ztree.all.js"></script>
    <script src="__ROOT__/Public/Admin/js/Contract/save.js"></script>
    <script type="text/javascript">
        
        var mycars=new Array(8)
        mycars[0]="丙"
        mycars[1]="丁"
        mycars[2]="戊"
        mycars[3]="己"
        mycars[4]="庚"
        mycars[5]="辛"
        mycars[6]="壬"
        mycars[7]="癸"
        //动态赋值
        function changepxx(){
            //var pxx=$('.pxx');
            var num=$('.pxx').length
            for (var i = 0; i < num; i++) {
                $($('.pxx')[i]).text(mycars[i]+'方');
            }
            $('#multipart').val(parseInt(num));


        }
        jQuery(document).ready(function($) {
            changepxx()
        });

    </script>
</body>

</html>
